Home:ALL Converter>Enums or constants in AngelScript

Enums or constants in AngelScript

Ask Time:2018-11-10T00:12:25         Author:Michael Dorner

Json Formatter

In other programming languages I can use static class methods or enums to encapsulate constants:

enum Command {
    command_1 = "0x00001",
    command_2 = "0x00002",
    command_2 = "0x00003"
} 

or

class Command  {
    static command_1 = "0x00001"
    static command_2 = "0x00002"
    static command_3 = "0x00003"    
}

How is this solved in AngelScript? As far as I know there are neither enums (with non-integer values) nor static class methods.

Author:Michael Dorner,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/53229400/enums-or-constants-in-angelscript
arie :

You can use namespace:\n\nnamespace consts_values\n{\n const string a = \"aaa\";\n const string b = \"bbb\";\n}\n",
2018-11-28T17:20:51
yy